package dataStructureAlgorithms.binaryTree;

/**
 * @description: TODO
 * @author: wzj
 * @create: 2019/5/17 9:14
 */
public class Tree {
    public static void main(String[] args) {
        Node root=new Node(0);
        BinaryTree binaryTree=new BinaryTree(root);

        Node leftNode=new Node(1);
        leftNode.setLeftNode(new Node(3));
        leftNode.setRightNode(new Node(4));

        Node rightNode=new Node(2);
        rightNode.setLeftNode(new Node(5));
        rightNode.setRightNode(new Node(6));

        root.setLeftNode(leftNode);
        root.setRightNode(rightNode);

        System.out.println("先序遍历");
        binaryTree.preorderTraversal(root);
        System.out.println("\n中序遍历");
        binaryTree.inorderTraversal(root);
        System.out.println("\n后序遍历");
        binaryTree.postorderTraversal(root);

    }
}
